

<div id="family-box">
<%# load :tabs%>
<script>set_tab_selected("groupmembersof", "");</script>
<table><tr>
<%if @group.depiction %>
<td><img src="<%=@group.depiction%>">
</td>
<%end %>
<td>
<h1>Welcome to <a href="<%=link%>"><%=@group.title%></a></h1> - 

<%=@group.description%>
</td></tr></table>
<br>

<script>var evenodd = true;</script>

<!--
<% if @user && !@group.is_a_member?(@user) %>
<a href="<%=link "join"%>?uid=<%=@session[:username]%>"  class="button">join <%=@group.title%></a>
<% end %>
<% if @user && @group.is_a_member?(@user) %>
<a href="<%=link "leave"%>/?uid=<%=@session[:username]%>"  class="button">leave <%=@group.title%></a>
<% end %>
-->

<%  show_details(@group, "group")  if @session[:username] == "testbrad" || @session[:username] == "JohnDoe" 
%>
<% if @user && @group && @user.id == @group.sponsor%>
You are the family moderator. You can:
<ul><li><a href="<%=link 'send_invite'%>" class="button" >Add family members</a></li>
<li><a href='/<%=@user.login%>/account/add'  class="button">add money to your family account</a>. You current family balance is $100.</li>
<li>transfer money from the family account to individual members' accounts</li>
<li><a href="<%=link 'edit'%>" id="groupedit"  class="button">set preferences</a> like group picture etc.</li>
</ul>

<%end%>
<hr>
<span class="mediumbold">Current members of <%=@group.title%></span> <% if @user && @group && @user.id == @group.sponsor%><a href="<%=link 'send_invite'%>" class="button" >Add another family member</a>
<% else %>
<br>(Moderator is <a href="/<%=@group.get_sponsor.login%>"><%=@group.get_sponsor.login%></a>) 
<%end%>
<div class="general-table">
<table >
<thead><th>Portrait</th><th>Name</th><th>Role</th><th>balance</th><th>Description</th></thead> <!--<th></th>-->
<%
 @users.each do |user|
   #write "<tr><td><img src='#{user.depiction||@default_depiction}' width='60px'/></td>"
   write "<tr><td><img src='" + user_pic_or_default(user.depiction) + "' width='40px'/></td>"
   write "<td><a href='/#{user.login}'>#{user.login}</a></td><td>#{user.role}</td>"
   money_in,money_out, balance, xfered = total_in_and_out(user.id)
   write "<td> #{balance}<a href='/#{user.login}/account/add'>add</a> #{@foo}</td>"
	
  # write "<td>#{user.description}</td>"
  write "<td>"
  	parnt = User.find_by_id(user.referer)
    write "#{parnt.login}" if parnt
	write "</td>" 
   if @user && @user.id == @group.sponsor
     #write "<td><a href='#{link 'evict'}?user=#{@user.login}'>evict</a></td>"
   end
   write "</tr>"
 end
%>
</table>
</div>

</div>


